package com.zhang.zxx.boot.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhang.zxx.boot.common.base.Response;
import com.zhang.zxx.boot.common.core.aop.MvcLog;
import com.zhang.zxx.boot.domain.dto.SysLogPageDTO;
import com.zhang.zxx.boot.entity.DO.SysLog;
import com.zhang.zxx.boot.service.SysLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 日志表: 接口控制层
 *
 * @author zhangxiaoxiang
 * @date 2021-12-12
 */
@Slf4j
@RestController
@Api(tags = "日志表接口管理")
@RequiredArgsConstructor
@RequestMapping("/sys-log")
public class SysLogController {
    private final SysLogService service;

    @ApiOperation(value = "SysLog列表接口")
    @PostMapping("/list")
    public Object list() {
        log.info("进入了SysLog列表接口");
        return service.list();
    }

    @MvcLog
    @ApiOperation(value = "日志分页")
    @PostMapping("/page")
    public Response<IPage<SysLog>> page(@RequestBody SysLogPageDTO dto) {
        return Response.data(service.sysLogPage(dto));
    }


}
